package com.hjm.project.BusinessInfo.BusinessInfo.service.impl;

import java.util.List;
import com.hjm.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hjm.project.BusinessInfo.BusinessInfo.mapper.BusinessInfoMapper;
import com.hjm.project.BusinessInfo.BusinessInfo.domain.BusinessInfo;
import com.hjm.project.BusinessInfo.BusinessInfo.service.IBusinessInfoService;
import com.hjm.common.utils.text.Convert;

/**
 * 图片Service业务层处理
 * 
 * @author BusinessInfo
 * @date 2020-11-30
 */
@Service
public class BusinessInfoServiceImpl implements IBusinessInfoService 
{
    @Autowired
    private BusinessInfoMapper businessInfoMapper;

    /**
     * 查询图片
     * 
     * @param id 图片ID
     * @return 图片
     */
    @Override
    public BusinessInfo selectBusinessInfoById(Long id)
    {
        return businessInfoMapper.selectBusinessInfoById(id);
    }

    /**
     * 查询图片列表
     * 
     * @param businessInfo 图片
     * @return 图片
     */
    @Override
    public List<BusinessInfo> selectBusinessInfoList(BusinessInfo businessInfo)
    {
        return businessInfoMapper.selectBusinessInfoList(businessInfo);
    }

    /**
     * 新增图片
     * 
     * @param businessInfo 图片
     * @return 结果
     */
    @Override
    public int insertBusinessInfo(BusinessInfo businessInfo)
    {
        businessInfo.setCreateTime(DateUtils.getDateTime());
        return businessInfoMapper.insertBusinessInfo(businessInfo);
    }

    /**
     * 修改图片
     * 
     * @param businessInfo 图片
     * @return 结果
     */
    @Override
    public int updateBusinessInfo(BusinessInfo businessInfo)
    {
        businessInfo.setUpdateTime(DateUtils.getDateTime());
        return businessInfoMapper.updateBusinessInfo(businessInfo);
    }

    /**
     * 删除图片对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBusinessInfoByIds(String ids)
    {
        return businessInfoMapper.deleteBusinessInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除图片信息
     * 
     * @param id 图片ID
     * @return 结果
     */
    @Override
    public int deleteBusinessInfoById(Long id)
    {
        return businessInfoMapper.deleteBusinessInfoById(id);
    }
    @Override
    public int deleteBusinessInfoByName(BusinessInfo businessInfo) {
        return businessInfoMapper.deleteBusinessInfoByName(businessInfo);
    }

}
